<!--风险任务提醒-->
<template>
  <div id="UnitaryCommonPage">
    <div class="UnitaryCommonPage-nfcc">
      <div style="margin-top: 10px">
        <van-search
          v-model="value"
          style="border-radius: 10px; height: 44px"
          background="#f7f8fa"
          placeholder="请输入搜索关键词"
          @search="serachData"
        />
      </div>
      <div class="UnitaryCommonPage-middle1" v-show="ListData.length > 0" ref="UnitaryCommonPageMiddle1">
        <ul v-for="(item, index) in ListData" :key="index" @click="handleAdd(item)" class="UnitaryCommonPage-middle">
          <li class="UnitaryCommonPage-middle2">
            户主姓名：{{ item.CQRMZ }}
            <span style="float: right;">{{item.DQZT == '626' ? '未推送' :item.DQZT == '627' ? '网格员巡查中' :item.DQZT == '628' ? '镇街审核' :item.DQZT == '629' ? '危改未申请' :item.DQZT == '630' ? '危改已申请' :item.DQZT == '631' ? '危房鉴定' :item.DQZT == '632' ? '危房整治' :item.DQZT == '633' ? '复核鉴定' :item.DQZT == '634' ? '归档' :item.DQZT == '638' ? '待巡查' :item.DQZT == '639' ? '未处理' :item.DQZT == '640' ? '已发送镇街排查' :item.DQZT == '641' ? '待排查' :item.DQZT == '642' ? '督促' :item.DQZT == '643' ? '已纳入房屋治理' :"备案"}}</span>
          </li>
          <li class="UnitaryCommonPage-middle3">
            行政村：{{item.CBJD}}
            <span> 安全鉴定或评定：{{ item.TASK_RECIEVEDATE }}</span>
          </li>
          <li class="UnitaryCommonPage-middle4">
            房屋地址：{{ item.FWYT == 606?'经营性自建房':"其他自建房" }}
          </li>
        </ul>
      </div>
      <div v-show="ListData.length == 0" style="height: 84vh; text-align: center; padding-top: 20vh">
        <div style="margin-bottom: 10px">
          <img src="https://nfzjszlb.jst.zj.gov.cn/serverfile/zheliban/icon/DSF/50.png" />
        </div>
        <div>暂无数据</div>
      </div>
      <div class="UnitaryCommonPage-footer" v-show="ISShow">
        <van-button color="dodgerblue" block @click="handleAdd">新增</van-button>
      </div>
    </div>
  </div>
</template>
<script>
  import dd from 'gdt-jsapi'
  import {
    QuerySignCallback,
  } from '@/utils/api'
  export default {
    data() {
      return {
        active: '0',
        value: '',
        ISShow: true,
        cityCode: '',
        ListData: [
          {
            FWYT: '0',
            CBPD: '0',
            CBJD: '0',
            XZYJ:"",
            TASK_RECIEVEDATE: Date.now(),
            CQRMZ: '1233',
          }
        ],
        deepListData:[

        ]
      }
    },
    methods: {
      // handleAdd(data) {
      //   this.$router.push({
      //     path: '/farmhouseInspector',
      //     query: {
      //       data: JSON.stringify(data),
      //     },
      //   })
      // },
      serachData(val) {
        if(!val) return this.ListData = this.deepListData
        this.ListData =  this.ListData.filter(item=>{
          return item.CQRMZ&&item.CQRMZ.indexOf(val)
        })
      },
      getData: async function () {
        // let accessCode = '688bd3883572440a859dfd8ba9194e7b'
        // let params = {
        //   accessCode: accessCode,
        //   cityCode: window.localStorage.getItem('citycode') ? window.localStorage.getItem('citycode') : '441300000000',
        //   params: {
        //     dataguid: '26ee90e4-90fd-4b2f-abc2-068e9ef008e9',
        //     strParams: [],
        //   },
        // }
        // const res = await QuerySignCallback(params)
        // this.ListData = JSON.parse(res.data.data).Data
        // this.deepListData = this.ListData
        // console.log(this.ListData,'hhh')
      },
    },
    created(){
    },
    mounted() {
      this.getData()
      dd.ready(function () {
        dd.setTitle({
          title: '风险任务提醒',
        })
          .then((res) => {})
          .catch((err) => {
            console.error(err)
          })
      })
    },
  }
</script>
<style lang="scss" scoped >
  #UnitaryCommonPage {
    height: 100vh;
    overflow: auto;
    background: #eee;
    width: 100vw;
    font-family: "Helvetica Neue", Helvetica, STHeiTi, sans-serif;
    font-size: 18px;
    padding: 6px 10px;
    .title {
      width: 100%;
      height: 46px;
      background: #007aff;
      line-height: 50px;
      text-align: center;
      color: #ffffff;
      font-size: 20px;
    }
    .UnitaryCommonPage-footer {
      width: 99%;
      margin-top: 4px;
      margin: 0 auto;
      padding-top: 12px;
    }
    .UnitaryCommonPage-middle1 {
      height: 84vh;
      overflow: auto;
      .UnitaryCommonPage-middle {
        background-color: #fff;
        border-radius: 10px;
        padding: 8px 10px;
        width: 98%;
        height: 130px;
        margin: 0 auto;
        margin-top: 14px;
        .UnitaryCommonPage-middle2 {
          font-size: 18px;
          font-weight: 1000;
          color: black;
          line-height: 36px;
        }
        .UnitaryCommonPage-middle3 {
          font-size: 14px;
          color: #aaa;
          line-height: 24px;
          span {
            float: right;
            // padding-left: 4vw;
          }
        }
        .UnitaryCommonPage-middle4 {
          font-size: 14px;
          color: #aaa;
          line-height: 24px;
          span {
            float: right;
            // padding-left: 4vw;
          }
        }
      }
    }
  }
</style>
<style>
  #UnitaryCommonPage .van-tab {
    font-size: 18px;
  }
</style>
